package cn.iocoder.yudao.module.resource.dal.dataobject.download;

import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

/**
 * 下载记录 DO
 *
 * @author 芋道源码
 */
@TableName(value = "resource_download", autoResultMap = true)
@KeySequence("resource_download_seq")
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ResourceDownloadDO extends TenantBaseDO {

    /**
     * 下载ID
     */
    @TableId
    private Long id;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 资源ID
     */
    private Long materialId;

    /**
     * 观看的广告ID
     *
     * 用于付费资源
     */
    private Long adId;

    /**
     * 是否免费下载
     *
     * 枚举 0-付费 1-免费
     */
    private Integer isFree;

}
